import Vue from 'vue'
import { sessionStore } from 'store/dist/store.legacy'
const state = {
  url: process.env.VUE_APP_advertList_url,
  advertObj: {} //列表
}

const getters = {

}

const mutations = {

}

const actions = {
  setList ({ state, commit }, cat_id) {
    let list = state[cat_id]
    if (list && list.length > 0) {
      return
    }
    window.axios.post(state.url, { cat_id: cat_id }).then(ret => {
      console.log(ret.data)
    })
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}